package com.ruoyi.property.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.property.mapper.FeeDiscountInfoMapper;
import com.ruoyi.property.domain.FeeDiscountInfo;
import com.ruoyi.property.service.IFeeDiscountInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 折扣设置Service业务层处理
 * 
 * @author sux
 * @date 2021-06-30
 */
@Service
public class FeeDiscountInfoServiceImpl implements IFeeDiscountInfoService 
{
    @Autowired
    private FeeDiscountInfoMapper feeDiscountInfoMapper;

    /**
     * 查询折扣设置
     * 
     * @param discountId 折扣设置ID
     * @return 折扣设置
     */
    @Override
    public FeeDiscountInfo selectFeeDiscountInfoById(Long discountId)
    {
        return feeDiscountInfoMapper.selectFeeDiscountInfoById(discountId);
    }

    /**
     * 查询折扣设置列表
     * 
     * @param feeDiscountInfo 折扣设置
     * @return 折扣设置
     */
    @Override
    public List<FeeDiscountInfo> selectFeeDiscountInfoList(FeeDiscountInfo feeDiscountInfo)
    {
        return feeDiscountInfoMapper.selectFeeDiscountInfoList(feeDiscountInfo);
    }

    /**
     * 新增折扣设置
     * 
     * @param feeDiscountInfo 折扣设置
     * @return 结果
     */
    @Override
    public int insertFeeDiscountInfo(FeeDiscountInfo feeDiscountInfo)
    {
        feeDiscountInfo.setCreateTime(DateUtils.getNowDate());
        return feeDiscountInfoMapper.insertFeeDiscountInfo(feeDiscountInfo);
    }

    /**
     * 修改折扣设置
     * 
     * @param feeDiscountInfo 折扣设置
     * @return 结果
     */
    @Override
    public int updateFeeDiscountInfo(FeeDiscountInfo feeDiscountInfo)
    {
        return feeDiscountInfoMapper.updateFeeDiscountInfo(feeDiscountInfo);
    }

    /**
     * 删除折扣设置对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFeeDiscountInfoByIds(String ids)
    {
        return feeDiscountInfoMapper.deleteFeeDiscountInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除折扣设置信息
     * 
     * @param discountId 折扣设置ID
     * @return 结果
     */
    @Override
    public int deleteFeeDiscountInfoById(Long discountId)
    {
        return feeDiscountInfoMapper.deleteFeeDiscountInfoById(discountId);
    }
}
